package me.android.library.ui.config;

import lombok.Data;
import lombok.EqualsAndHashCode;
import me.android.library.ui.api.Page;
import me.android.library.utils.android.ResourcesUtil;

/**
 * Created by sylar on 15/6/3.
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PageInfo extends BaseElement<Page> {

    protected String animInRes;

    protected String animOutRes;

    public PageInfo() {
    }

    @Override
    public Page get() {
        if (t == null) {
            t = super.get();
            t.setPageKey(id);
            t.setPageTitle(getName());
        }
        return super.get();
    }

    public int getAnimInResId() {
        return ResourcesUtil.getResourceId(animInRes);
    }

    public int getAnimOutResId() {
        return ResourcesUtil.getResourceId(animOutRes);
    }
}
